package io;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.util.Arrays;

public class ObjectOutputStreamDemo01 {
    public static void main(String[] args) throws IOException {
        Message m = new Message(1, "标题", "内容");
        ObjectOutputStream oos =
                new ObjectOutputStream(
                        new FileOutputStream("message.txt"));

        oos.writeObject(m);
        System.out.println("序列化ok");


        oos.close();


    }
}
